/*******************************************************************************
 * Copyright (c) 2010-2019 Oak Ridge National Laboratory.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.csstudio.apputil.formula.node;

import org.csstudio.apputil.formula.Node;

/** One computational node.
 *  @author Kay Kasemir
 */
public class SubNode extends AbstractBinaryNode
{
	 /**
     * Constructor
     * @param left , left node
     * @param right , right node
     */
	public SubNode(Node left, Node right)
    {
        super(left, right);
    }

    @Override
    protected double calc(final double a, final double b)
    {
        return a-b;
    }

    @Override
    public String toString()
    {
        return "(" + left + " - " + right + ")";
    }
}
